import request from '@/utils/request';

// 导出邮箱配置列表
export function exportEmailConfig(params) {
  return request({
    url: '/basic/system/basicEmailConfig/export',
    method: 'post',
    data: params, // 使用POST请求体传递参数
    responseType: 'blob' // 二进制流响应
  })
}

// 测试发送邮件
export function sendTestEmail(data) {
  return request({
    url: '/basic/system/basicEmailConfig/sendMail',
    method: 'post',
    data: data // 使用GET请求参数
  })
}

// 新增邮箱配置
export function addEmailConfig(data) {
  return request({
    url: '/basic/system/basicEmailConfig',
    method: 'post',
    data: data // 使用POST请求体
  })
}

// 修改邮箱配置
export function updateEmailConfig(data) {
  return request({
    url: '/basic/system/basicEmailConfig',
    method: 'put',
    data: data // 使用PUT请求体
  })
}

// 查询邮箱配置列表
export function listEmailConfig(params) {
  return request({
    url: '/basic/system/basicEmailConfig/list',
    method: 'get',
    params: params // 使用GET请求参数
  })
}

// 获取邮箱配置详细信息
export function getEmailConfig(emailConfigId) {
  return request({
    url: `/basic/system/basicEmailConfig/${emailConfigId}`,
    method: 'get'
  })
}

// 删除邮箱配置
export function deleteEmailConfig(emailConfigIds) {
  return request({
    url: `/basic/system/basicEmailConfig/${emailConfigIds}`,
    method: 'delete'
  })
}


// 获取供应商下拉列表 
export function getSupplierSelect() {
  return request({
    url: '/basic/system/basicSupplierInfo/supplierList',
    method: 'get'
  })
}